Cmotions Dataloader
cmo_dataloader is a Python library created by The Analytics Lab, which is powered by Cmotions. This library combines our most used functionality when it comes to loading flat files or database tables into Python in bulk. Regarding flat files it also tries to take into account which separator, decimal sign and encoding to use when loading a file, this way the data is loaded automatically the best way possible, so you don't have to waste time fixing difficult bugs and errors. Nothing fancy, but very useful for our consultants. Mostly since this package is used in other packages, which makes our workflow simpler and more efficient.
Since we love to share what we do, why not also do that with our packages, that is why we've decided to make (almost) all of our packages open source, this way we hope to give back to the community that brings us so much. Enjoy!
Installation
Install cmo_dataloader using pip
pip install cmo-dataloader
If you want to be able to use the tutorial notebook or the code below, you also need to install dotenv using pip
pip install python-dotenv
Usage
import os
from dotenv import load_dotenv
from cmo_dataloader.resources import get_data_path
import cmo_dataloader as dl
load_dotenv()
# load flat files from a directory
dlc = dl.load_flat_file(get_data_path('formula_1'))
datafiles_dict = dlc.load()
# load tables from a SQL Server database
# using credentials stored in a .env file
ddu = dl.load_database(server=os.getenv("DB1_SERVER")
, db=os.getenv("DB1_DATABASE")
, server_name=os.getenv("DB1_SERVER_NAME")
, usr=os.getenv("DB1_USERNAME")
, pwd=os.getenv("DB1_PASSWORD")
, driver=os.getenv("DB1_DRIVER")
, port=os.getenv("DB1_PORT")
, tables=['dbo.mytable', 'dbo.anothertable'])
datafiles_dict = ddu.load()
# load tables from a SQL Server database
# using your Windows credentials
ddu = dl.load_database(server="localhost"
, db="mylocaldb"
, tables=['dbo.mytable', 'dbo.anothertable'])
datafiles_dict = ddu.load()
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.
License
GNU General Public License v3.0
Contributors
Jeanine Schoonemann
Contact us
Metadata
Release files for cmo-dataloader 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cmo_dataloader-0.1.0.tar.gz | 8.4 kB | Without provenance | Details for cmo_dataloader-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cmo_dataloader-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for cmo_dataloader-0.1.0-py3-none-any.whl |
Total release size: 16.4 kB
Release files / cmo_dataloader-0.1.0.tar.gz
| Download URL | cmo_dataloader-0.1.0.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed638c62122338974aeff4790d813d282573d947350dac86d0f6cd1b6eb1cf82
|
|
BLAKE2b-256 checksum How to use checksums |
50653d90e62153eb671592fede8fe682115501b2ce69fae5a803a4f5b99e7546
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / cmo_dataloader-0.1.0-py3-none-any.whl
| Download URL | cmo_dataloader-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
398b76a46dfbc9d49833827155f62ac0b8a65c00313933f2a8b255394153e033
|
|
BLAKE2b-256 checksum How to use checksums |
ffd6bafb22ebfb4d6ef9fadbad7d8acdeba73fce5fca39c005e1036bc1c1e9df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for cmo-dataloader 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.