Skip to main content

Social Finance Data Pipeline

This is a package that aims to standerdise one or more datasets against a defined schema. It is currently in it's very early stagies.

check the wiki for more details on the plan.

Current status

Current the pipeline only works with xml files and is limited to one schema and one file. It's a first generic approach, that was tested against CIN and SWWF datasets.

It covers partially the following steps described in the wiki:

  • Identify - identifies the stream of data against the schema. only for XML files for now.
  • Convert - Tries to converts the datatypes and throws a warning when not possible. It uses the xsdata package for it.
  • Normalise - adds the primary and foreign keys for each record.

How to run

Check the demo.py file. It has 2 functions that run against the CIN and SWWF datasets present in the samples directory.

There's also smaller samples of those datasets.

This methods will print a set of dataframes for each dataset.

Improvements

There's still a lot to be done. Besides completing what's in the wiki, here are some things I believe should be done first:

  • Datastore - the values are directly pulled to a tablib databook in a very unneficcient nested for loop. This is a big no. We should use RTOF datstore for this.

  • Datatypes It should be possible to define the way we want to export the datatypes. maybe the user wants the dates to come out in a the "dd-mm-yyyy" format when exporting. Or maybe they want just mm-yyyy. This should be possible. Currently, I'm assuming this in export_value. But it should be adjusted.

  • path vs context - I was using path as a reference for where the each node sits in the hierarchy. However, having a tuple in the context is probably a better approach. I'm currently using both, this should not be the case - use just the context.

Metadata

Release files for sfdata 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sfdata 0.1.3
File Size Uploaded
sfdata-0.1.3.tar.gz 21.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sfdata 0.1.3
File Interpreter ABI Platform
sfdata-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 50.8 kB

Release files / sfdata-0.1.3.tar.gz

Download URL sfdata-0.1.3.tar.gz
Size 21.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a757e81f8fe87bbafc894ad55b4e91fd9c4efb7f744ca9ac24b5f763749afbe3
BLAKE2b-256 checksum
How to use checksums
65f4791fd06d0bf84ecff928f99b8188136cf8365f240461f6b4c2cbc53b0423
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0

Release files / sfdata-0.1.3-py3-none-any.whl

Download URL sfdata-0.1.3-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb864a1a9206c23db70440019d2e1a86eba5099bb8be20a86e25493147491ad1
BLAKE2b-256 checksum
How to use checksums
612c3a541e7797f058b714bdca7c09979540973705b11a608a8350e8056de15d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page