# pySidraData
![Python Version](https://img.shields.io/badge/python-3.6%2B-blue)
![License](https://img.shields.io/badge/license-MIT-green)
[![Build Status](https://github.com/nandevers/pySidraData/workflows/Build/badge.svg)](https://github.com/nandevers/pySidraData/actions)
[![Coverage Status](https://coveralls.io/repos/github/nandevers/pySidraData/badge.svg?branch=main)](https://coveralls.io/github/nandevers/pySidraData?branch=main)
`pySidraData` is a Python client for interacting with the IBGE (Instituto Brasileiro de Geografia e EstatÃstica) API for aggregate data. It provides an easy-to-use interface to fetch, manipulate, and analyze data from the IBGE database.
## Features
- Fetch and explore root data from the IBGE API.
- Retrieve metadata for specific aggregate IDs.
- Convert data to a Pandas DataFrame for analysis.
- Easy-to-use and extendable structure.
- Supports Python 3.6 and above.
## Installation
You can install `pySidraData` using pip:
```bash
pip install pySidraData
```
Alternatively, you can install it from the source:
```bash
git clone https://github.com/nandevers/pySidraData.git
cd pySidraData
pip install .
```
## Usage
Here's a quick example of how to use `pySidraData`:
```python
from pySidraData import Client
# Initialize the client
client = Client()
# Get root data
root_data = client.get_root_data()
for research in root_data.research_list:
print(f"Research ID: {research.id}, Name: {research.nome}")
for aggregate in research.agregados:
print(f" Aggregate ID: {aggregate.id}, Name: {aggregate.nome}")
# Get metadata for a specific aggregate ID
metadata = client.get_metadata('8418')
print(metadata)
# Convert root data to a Pandas DataFrame
df = client.get_root_data_as_dataframe()
print(df.head())
```
## Documentation
The full documentation for `pySidraData` can be found [here](https://github.com/nandevers/pySidraData/wiki).
## Contributing
We welcome contributions to `pySidraData`! If you have an idea for a feature or have found a bug, please check our [contributing guidelines](https://github.com/nandevers/pySidraData/blob/main/CONTRIBUTING.md) before you start. Here are some ways you can contribute:
- **Reporting Bugs**: Use the [issue tracker](https://github.com/nandevers/pySidraData/issues) to report any bugs you find.
- **Feature Requests**: If you have an idea for a new feature, please submit it as an issue with the label `enhancement`.
- **Pull Requests**: If you want to contribute code, fork the repository and create a pull request with your changes.
- **Documentation**: Help improve our documentation or add new examples.
We use `pre-commit` hooks to ensure code quality. Please install the hooks before making commits:
```bash
pip install pre-commit
pre-commit install
```
### Setting Up the Development Environment
To set up the development environment, follow these steps:
1. Clone the repository:
```bash
git clone https://github.com/nandevers/pySidraData.git
cd pySidraData
```
2. Create and activate a virtual environment:
```bash
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
```
3. Install the package in editable mode with development dependencies:
```bash
pip install -e .[dev]
```
4. Run the tests to make sure everything is set up correctly:
```bash
python -m unittest discover tests
```
### Running Tests
We use `unittest` for testing. To run the tests, use the following command:
```bash
python -m unittest discover tests
```
Make sure all tests pass before submitting a pull request.
### Code Style
We follow PEP 8 for code style. Please ensure your code is formatted correctly before submitting a pull request. You can use `flake8` to check for any style issues:
```bash
flake8 pySidraData/
```
## License
`pySidraData` is licensed under the MIT License. See the [LICENSE](https://github.com/nandevers/pySidraData/blob/main/LICENSE) file for more information.
## Acknowledgements
This project was inspired by the need to easily interact with the IBGE API for data analysis and research purposes. Special thanks to the IBGE for providing an accessible API.
## Contact
If you have any questions or suggestions, feel free to open an issue or reach out to the maintainer at fernando.liaison@gmail.com.
Happy coding! We hope `pySidraData` makes your data analysis work easier and more enjoyable.
Raw data
{
"_id": null,
"home_page": null,
"name": "pySidraData",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "IBGE, API, data, sidra",
"author": "Fernando Barbosa",
"author_email": "Fernando Barbosa <fernando.liaison@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d5/2a/22ce075b49500192d2c97ffaa183d176a706757bf44e1706acc63c307dbc/pysidradata-0.1.2.tar.gz",
"platform": null,
"description": "# pySidraData\r\n\r\n![Python Version](https://img.shields.io/badge/python-3.6%2B-blue)\r\n![License](https://img.shields.io/badge/license-MIT-green)\r\n[![Build Status](https://github.com/nandevers/pySidraData/workflows/Build/badge.svg)](https://github.com/nandevers/pySidraData/actions)\r\n[![Coverage Status](https://coveralls.io/repos/github/nandevers/pySidraData/badge.svg?branch=main)](https://coveralls.io/github/nandevers/pySidraData?branch=main)\r\n\r\n`pySidraData` is a Python client for interacting with the IBGE (Instituto Brasileiro de Geografia e Estat\u00edstica) API for aggregate data. It provides an easy-to-use interface to fetch, manipulate, and analyze data from the IBGE database.\r\n\r\n## Features\r\n\r\n- Fetch and explore root data from the IBGE API.\r\n- Retrieve metadata for specific aggregate IDs.\r\n- Convert data to a Pandas DataFrame for analysis.\r\n- Easy-to-use and extendable structure.\r\n- Supports Python 3.6 and above.\r\n\r\n## Installation\r\n\r\nYou can install `pySidraData` using pip:\r\n\r\n```bash\r\npip install pySidraData\r\n```\r\n\r\nAlternatively, you can install it from the source:\r\n\r\n```bash\r\ngit clone https://github.com/nandevers/pySidraData.git\r\ncd pySidraData\r\npip install .\r\n```\r\n\r\n## Usage\r\n\r\nHere's a quick example of how to use `pySidraData`:\r\n\r\n```python\r\nfrom pySidraData import Client\r\n\r\n# Initialize the client\r\nclient = Client()\r\n\r\n# Get root data\r\nroot_data = client.get_root_data()\r\nfor research in root_data.research_list:\r\n print(f\"Research ID: {research.id}, Name: {research.nome}\")\r\n for aggregate in research.agregados:\r\n print(f\" Aggregate ID: {aggregate.id}, Name: {aggregate.nome}\")\r\n\r\n# Get metadata for a specific aggregate ID\r\nmetadata = client.get_metadata('8418')\r\nprint(metadata)\r\n\r\n# Convert root data to a Pandas DataFrame\r\ndf = client.get_root_data_as_dataframe()\r\nprint(df.head())\r\n```\r\n\r\n## Documentation\r\n\r\nThe full documentation for `pySidraData` can be found [here](https://github.com/nandevers/pySidraData/wiki).\r\n\r\n## Contributing\r\n\r\nWe welcome contributions to `pySidraData`! If you have an idea for a feature or have found a bug, please check our [contributing guidelines](https://github.com/nandevers/pySidraData/blob/main/CONTRIBUTING.md) before you start. Here are some ways you can contribute:\r\n\r\n- **Reporting Bugs**: Use the [issue tracker](https://github.com/nandevers/pySidraData/issues) to report any bugs you find.\r\n- **Feature Requests**: If you have an idea for a new feature, please submit it as an issue with the label `enhancement`.\r\n- **Pull Requests**: If you want to contribute code, fork the repository and create a pull request with your changes.\r\n- **Documentation**: Help improve our documentation or add new examples.\r\n\r\nWe use `pre-commit` hooks to ensure code quality. Please install the hooks before making commits:\r\n\r\n```bash\r\npip install pre-commit\r\npre-commit install\r\n```\r\n\r\n### Setting Up the Development Environment\r\n\r\nTo set up the development environment, follow these steps:\r\n\r\n1. Clone the repository:\r\n\r\n ```bash\r\n git clone https://github.com/nandevers/pySidraData.git\r\n cd pySidraData\r\n ```\r\n\r\n2. Create and activate a virtual environment:\r\n\r\n ```bash\r\n python -m venv venv\r\n source venv/bin/activate # On Windows use `venv\\Scripts\\activate`\r\n ```\r\n\r\n3. Install the package in editable mode with development dependencies:\r\n\r\n ```bash\r\n pip install -e .[dev]\r\n ```\r\n\r\n4. Run the tests to make sure everything is set up correctly:\r\n\r\n ```bash\r\n python -m unittest discover tests\r\n ```\r\n\r\n### Running Tests\r\n\r\nWe use `unittest` for testing. To run the tests, use the following command:\r\n\r\n```bash\r\npython -m unittest discover tests\r\n```\r\n\r\nMake sure all tests pass before submitting a pull request.\r\n\r\n### Code Style\r\n\r\nWe follow PEP 8 for code style. Please ensure your code is formatted correctly before submitting a pull request. You can use `flake8` to check for any style issues:\r\n\r\n```bash\r\nflake8 pySidraData/\r\n```\r\n\r\n## License\r\n\r\n`pySidraData` is licensed under the MIT License. See the [LICENSE](https://github.com/nandevers/pySidraData/blob/main/LICENSE) file for more information.\r\n\r\n## Acknowledgements\r\n\r\nThis project was inspired by the need to easily interact with the IBGE API for data analysis and research purposes. Special thanks to the IBGE for providing an accessible API.\r\n\r\n## Contact\r\n\r\nIf you have any questions or suggestions, feel free to open an issue or reach out to the maintainer at fernando.liaison@gmail.com.\r\n\r\nHappy coding! We hope `pySidraData` makes your data analysis work easier and more enjoyable.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python client for interacting with IBGE API for aggregate data.",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/nandevers/pySidraData",
"Repository": "https://github.com/nandevers/pySidraData"
},
"split_keywords": [
"ibge",
" api",
" data",
" sidra"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3ad73f50a90235cf223189e86751a140c691bce8656efa5d474abcbeb93e2a7d",
"md5": "c58e080f99311e03403ba2de3cf145cd",
"sha256": "6c68d80392ab748110f00d960efa67e819e4bb326cc7956f4d1c0bf0547e2f19"
},
"downloads": -1,
"filename": "pySidraData-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c58e080f99311e03403ba2de3cf145cd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9066,
"upload_time": "2024-09-17T23:04:36",
"upload_time_iso_8601": "2024-09-17T23:04:36.711691Z",
"url": "https://files.pythonhosted.org/packages/3a/d7/3f50a90235cf223189e86751a140c691bce8656efa5d474abcbeb93e2a7d/pySidraData-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d52a22ce075b49500192d2c97ffaa183d176a706757bf44e1706acc63c307dbc",
"md5": "dbb8c303dca3216986dd39dd9a2ae632",
"sha256": "3dc4b308707792dfa834fa49e1e228a07f16f3cfa082e55fc6e36c97be1d4112"
},
"downloads": -1,
"filename": "pysidradata-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "dbb8c303dca3216986dd39dd9a2ae632",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8764,
"upload_time": "2024-09-17T23:04:38",
"upload_time_iso_8601": "2024-09-17T23:04:38.179991Z",
"url": "https://files.pythonhosted.org/packages/d5/2a/22ce075b49500192d2c97ffaa183d176a706757bf44e1706acc63c307dbc/pysidradata-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-17 23:04:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nandevers",
"github_project": "pySidraData",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "requests",
"specs": [
[
">=",
"2.0"
]
]
},
{
"name": "pandas",
"specs": [
[
">=",
"1.0"
]
]
}
],
"lcname": "pysidradata"
}