Skip to main content

Package to convert JSON data in SQL table.

Project description

MACEIÓ

Package to insert JSON data in SQL database.

Features

  • Create a new table based a json structure
  • Insert a new line or update in table;

How to use

from Maceio.Maceio import Maceio

if __name__ == "__main__":
    # You can use only one dict withou list.
    data = '''[
            {
                "field1":{
                    "subfield1": 1,
                    "subfield2": "TYPE1",
                    "subfield3":{
                        "sub1":"Value 1",
                        "sub2":"Value 2",
                    }
                }
            },
            {
                "field1":{
                    "subfield1": 2,
                    "subfield2": "TYPE1",
                    "subfield3":{
                        "sub1":"Value 3",
                        "sub2":"Value 4",
                    }
                }
            }
        ]
    ''')

    maceio = Maceio('postgresql+psycopg2://user:password@host:port/database', 'schema_example')
    maceio.save('table_example', data, conflicts=('subfield1', 'subfield2'))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Maceio-1.0.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Maceio-1.0.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file Maceio-1.0.2.tar.gz.

File metadata

  • Download URL: Maceio-1.0.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.10

File hashes

Hashes for Maceio-1.0.2.tar.gz
Algorithm Hash digest
SHA256 15fef9898945ab006a52207b48c88c3ac59110d1a7bf2d774f6c6efd46022869
MD5 9eb90cbf9a2f7774cd5de6229236ba1e
BLAKE2b-256 f317f4c6fb73a1df1c2ef892fd2c18505b3f4d95ebdf5186179a8fe18e0fc585

See more details on using hashes here.

File details

Details for the file Maceio-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: Maceio-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.10

File hashes

Hashes for Maceio-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 03a3e75ce5d29f8dc93c414c2c88b98556a4d610fdfaaab61dc1e60596e4ae1b
MD5 7e3882e9756eaa3ca306f63e30d9523f
BLAKE2b-256 d8c31fd00011e049082516d6b7cce7f6208559342d86cf5683a3723a74089688

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page