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.0.tar.gz (4.0 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.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Maceio-1.0.0.tar.gz
  • Upload date:
  • Size: 4.0 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.0.tar.gz
Algorithm Hash digest
SHA256 4d47d368dcf6b395ea64015353c03d4f05fc7dfdc8f5de701b6e63c0899a2171
MD5 70a5c622d4ea0d548dba667d90252bea
BLAKE2b-256 0425f3a47ce7a71819bd80fa1a3f879b8549ca78e2a5c89ee20caa5548506725

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Maceio-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4c063a24b53d8a673d6b5b2ea42136394fd371b6d4f6f77aea663d7fbeb001d
MD5 447223f48a91fea04f04a869cbaac892
BLAKE2b-256 a60fc003160226c7afdd49217218a4d61bf3297c9a74f6d4c87d6cef074bea03

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