Library for creating data services
Project description
coopio
Library for creating data services
CsvDataService Example:
class Dummy:
def __init__(self, a, b, c):
self.a = a
self.b = b
self.c = c
def __str__(self):
return f"a: {self.a}, b: {self.b}, c: {self.c}"
def __repr__(self):
return self.__str__()
class CsvDataService_Dummy(ICsvDataService):
def __init__(self, data_file_path: str):
ICsvDataService.__init__(self, data_file_path)
def translate_from_data_rows(self, df: pd.DataFrame) -> List[T]:
ret_dummies = []
for i, row in df.iterrows():
new_dummy = Dummy(
a=row['a'],
b=row['b'],
c=row['c']
)
ret_dummies.append(new_dummy)
return ret_dummies
After Establishing the data service, data can be stored or retrieved as follows:
dummies = []
for ii in range(0, 5):
dummies.append(Dummy(ii, 2, 3))
data_service.add_or_update(obj_identifier='a', objs=dummies)
stored = data_service.retrieve_data(obj_identifier='a')
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
coopio-0.7.tar.gz
(3.1 kB
view details)
Built Distribution
coopio-0.7-py3-none-any.whl
(4.8 kB
view details)
File details
Details for the file coopio-0.7.tar.gz
.
File metadata
- Download URL: coopio-0.7.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f094b040da5419985f94c275922c7fba1ce5ce4982f9626cda047cc89100030d |
|
MD5 | ccca9c137ea5049a916ab28c431611f2 |
|
BLAKE2b-256 | 28e20056f2a1cb8e4891ee574a35688aa90309b256c69355b52747cf9a18db0f |
File details
Details for the file coopio-0.7-py3-none-any.whl
.
File metadata
- Download URL: coopio-0.7-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 057bf76482604fa42c13846ae1d98b3c32507f9fced8847888a25fab3efb9b53 |
|
MD5 | 07026e26c3459d1dd5ef203ca2e7e2b5 |
|
BLAKE2b-256 | f4da3143ef1418bde6e8759428bd92f5c1715d2bf2ba4faaca880e3454d5916f |