https://github.com/gersonfreire/soawebservices
SOA WebServices SDK and CLI (command line interface)
https://github.com/gersonfreire/soawebservices
cnh cnpj cnpj-validator cpf cpf-validador kyc processos rfb serasa soawebservices
Last synced: 8 months ago
JSON representation
SOA WebServices SDK and CLI (command line interface)
- Host: GitHub
- URL: https://github.com/gersonfreire/soawebservices
- Owner: gersonfreire
- License: mit
- Created: 2025-01-18T18:20:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-21T20:34:29.000Z (over 1 year ago)
- Last Synced: 2025-06-30T00:04:43.475Z (11 months ago)
- Topics: cnh, cnpj, cnpj-validator, cpf, cpf-validador, kyc, processos, rfb, serasa, soawebservices
- Language: Python
- Homepage: https://www.soawebservices.com.br/
- Size: 28.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# SOA WebServices SDK
[🇧🇷 Versão em Português](README_pt.md)
A Python SDK and CLI for interacting with SOA WebServices API ([SOAWebservices Web Site](https://www.soawebservices.com.br/))
# SOA WebServices SDK
## Installation
1. Clone the repository
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Configure environment variables in `.env`:
```
BASE_URL=https://homologacao.soawebservices.com.br
PROD_BASE_URL=https://services.soawebservices.com.br
EMAIL=
PASSWORD=
```
## Where to manage your account and get the credentials:
* [SOAWebServices Portal](https://portal.soawebservices.com.br/Identity/Login)
* [SOAWebservices Web Site](https://www.soawebservices.com.br/)
## Usage
### As a Library
```python
from soa_sdk.client import SOAWebServicesClient
# Initialize client
client = SOAWebServicesClient()
# Get account balance
balance = client.get_saldo()
# Get synthetic statement
statement = client.get_extrato_sintetico(2023, 12)
# Get NFe information for individual
nfe = client.get_pessoa_fisica_nfe("12345678900", "1990-01-01")
```
### Using the CLI
```bash
# Get account balance
soa-cli saldo
# Get synthetic statement
soa-cli extrato-sintetico --ano 2023 --mes 12
# Get NFe information for individual
# Get NFe information for company
soa-cli pessoa-juridica-nfe --documento 12345678000190
```
## Features
- Complete API coverage
- Automatic logging to file and console
- Type validation using Pydantic
- Rich CLI interface
- Environment-based configuration
## Logging
Logs are written to `logs/soa_sdk.log` and rotated when they reach 10MB in size. The last 5 log files are kept.
## Error Handling
The SDK includes comprehensive error handling and logging. All API errors are logged and raised as exceptions.
## References:
* [Services status](https://status.i-stream.com.br/status/servicos)
* [API Swagger docs](https://services.soawebservices.com.br/documentacao/index.html)
* [New CNPJ](https://github.com/gersonfreire/novo-cnpj)
* [Telegram Bot](https://t.me/PessoaBot)
## How to Contribute
1. Fork the repository
2. Create a new branch (`git checkout -b feature-branch`)
3. Make your changes
4. Commit your changes (`git commit -m 'Add new feature'`)
5. Push to the branch (`git push origin feature-branch`)
6. Open a Pull Request
---