Skip to content

Commit 6771b75

Browse files
committed
I made a new Borsdata client build on modern Python principles.
0 parents  commit 6771b75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+9396
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ""
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
15+
1. Initialize client with '...'
16+
2. Call method '....'
17+
3. See error
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Code Sample**
23+
24+
```python
25+
# Add your code here
26+
```
27+
28+
**Environment (please complete the following information):**
29+
30+
- OS: [e.g. Ubuntu 20.04]
31+
- Python Version: [e.g. 3.8]
32+
- Package Version: [e.g. 0.1.0]
33+
34+
**Additional context**
35+
Add any other context about the problem here.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ""
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Describe alternatives you've considered**
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
**Additional context**
19+
Add any other context or screenshots about the feature request here.

.github/workflows/python-tests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Python Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.7, 3.8, 3.9, "3.10"]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install -r requirements-dev.txt
26+
- name: Run tests
27+
run: |
28+
pytest --cov=src/borsdata_client tests/
29+
env:
30+
BORSDATA_API_KEY: ${{ secrets.BORSDATA_API_KEY }}
31+
- name: Upload coverage reports to Codecov
32+
uses: codecov/codecov-action@v3
33+
with:
34+
token: ${{ secrets.CODECOV_TOKEN }}
35+
fail_ci_if_error: false

.gitignore

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.nox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
*.py,cover
48+
.hypothesis/
49+
.pytest_cache/
50+
cover/
51+
52+
# Jupyter Notebook
53+
.ipynb_checkpoints
54+
55+
# IPython
56+
profile_default/
57+
ipython_config.py
58+
59+
# pyenv
60+
.python-version
61+
62+
# Environments
63+
.env
64+
.venv
65+
env/
66+
venv/
67+
ENV/
68+
env.bak/
69+
venv.bak/
70+
71+
# Spyder project settings
72+
.spyderproject
73+
.spyproject
74+
75+
# PyCharm
76+
.idea/
77+
78+
# VS Code
79+
.vscode/
80+
81+
# mypy
82+
.mypy_cache/
83+
.dmypy.json
84+
dmypy.json
85+
86+
# Pyre type checker
87+
.pyre/
88+
89+
# pytype static type analyzer
90+
.pytype/
91+
92+
# Cursor IDE
93+
.cursor/
94+
.cursor.json
95+
.cursor-cache/
96+
97+
# Mac OS
98+
.DS_Store
99+
100+
# Pytest
101+
pytest-report.xml
102+
103+
# Coverage
104+
coverage-report/
105+
106+
# Logs
107+
*.log

CONTRIBUTING.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Contributing to Borsdata API Client
2+
3+
Thank you for considering contributing to the Borsdata API Client! This document provides guidelines and instructions for contributing.
4+
5+
## Code of Conduct
6+
7+
Please be respectful and considerate of others when contributing to this project.
8+
9+
## How to Contribute
10+
11+
1. Fork the repository
12+
2. Create a new branch for your feature or bugfix: `git checkout -b feature/your-feature-name` or `git checkout -b fix/your-bugfix-name`
13+
3. Make your changes
14+
4. Run tests to ensure your changes don't break existing functionality: `pytest`
15+
5. Commit your changes with a descriptive commit message
16+
6. Push your branch to your fork: `git push origin your-branch-name`
17+
7. Create a pull request to the main repository
18+
19+
## Development Setup
20+
21+
1. Clone the repository
22+
2. Create a virtual environment: `python -m venv .venv`
23+
3. Activate the virtual environment:
24+
- Windows: `.venv\Scripts\activate`
25+
- Unix/MacOS: `source .venv/bin/activate`
26+
4. Install development dependencies: `pip install -r requirements-dev.txt`
27+
5. Create a `.env` file with your Borsdata API key:
28+
```
29+
BORSDATA_API_KEY=your_api_key_here
30+
```
31+
32+
## Testing
33+
34+
Run tests with pytest:
35+
36+
```bash
37+
pytest
38+
```
39+
40+
For coverage report:
41+
42+
```bash
43+
pytest --cov=src/borsdata_client tests/
44+
```
45+
46+
## Code Style
47+
48+
This project follows PEP 8 style guidelines with a line length of 88 characters. We use Black for code formatting and isort for import sorting.
49+
50+
Format your code before submitting:
51+
52+
```bash
53+
black src tests
54+
isort src tests
55+
```
56+
57+
## Type Hints
58+
59+
All code should include proper type hints according to PEP 484.
60+
61+
## Documentation
62+
63+
Please update documentation when adding or modifying features. This includes:
64+
65+
- Docstrings for new functions, methods, and classes
66+
- Updates to README.md if necessary
67+
- New or updated examples in the docs directory
68+
69+
## Pull Request Process
70+
71+
1. Ensure your code passes all tests
72+
2. Update documentation if necessary
73+
3. The PR should work for Python 3.7 and above
74+
4. Your PR will be reviewed by maintainers, who may request changes
75+
76+
## License
77+
78+
By contributing to this project, you agree that your contributions will be licensed under the project's MIT License.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)