Python package to consume SPEC SA and third-party apps
Project description
SPEC Utils
SPEC-Utils is a set of connectors to consume Grupo SPEC and third-party applications from Python.
SPEC-Utils is used by Grupo SPEC within netSync, but it can be used by anyone in their integration projects -or any other purpose that they want :sunglasses: -.
Why use Spec-Utils?
- :zap: Fast to code: Increase the speed to develop integrations features by about 200% to 300%. *
- :x: Fewer bugs: Reduce about 40% of human (developer) induced errors. *
- :bulb: Intuitive: Great editor support. Completion everywhere. Less time debugging.
- :nerd_face: Easy: Designed to be easy to use and learn. Less time reading docs.
- :part_alternation_mark: Short: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
* Estimation based on tests on an internal development team, building production applications.
For more info and help, visit the SPEC-Utils Repo.
Requirements
Python 3.8+
SPEC-Utils stands on shoulders of:
- requests: For the synchronous HTTP requests.
- aiohttp: For the asynchronous HTTP requests.
- pandas: For the database features.
- SQLAlchemy: For the database connections.
- pydantic: For the data parts.
Install
Can use:
pip install spec-utils
Or:
python -m pip install spec-utils
Example
Net-Time
Import module
from spec_utils import nettime6 as nt6
Client settings
URL = '<your-nettime-url>'
USERNAME = '<your-username>'
PWD = '<your-password>'
Create a client
client = nt6.Client(url=URL, username=USERNAME, pwd=PWD)
client.is_connected
# False
Start session
client.start_session()
client.is_connected
# True
Get employees with summary method
client.get_employees()
# {
# 'total': 2,
# 'items': [{'id': 1, 'nif': '123789456'}, {'id': 2, 'nif': '987321654'}
# ]}
Or use with
expression ...
with nt6.Client(url=URL, username=USERNAME, pwd=PWD) as client:
print(client.get_employees())
# {
# 'total': 2,
# 'items': [{'id': 1, 'nif': '123789456'}, {'id': 2, 'nif': '987321654'}
# ]}
License
This project is licensed under the terms of the GNU GPLv3 license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
spec_utils-0.19.2.tar.gz
(26.1 kB
view hashes)