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.4.tar.gz (5.1 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.4-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Maceio-1.0.4.tar.gz
  • Upload date:
  • Size: 5.1 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.4.tar.gz
Algorithm Hash digest
SHA256 d1f0452c060e6b8fbbcaf9069615360d93cbbaf328ba917fe867c360f7febefe
MD5 7dcf46ad2dabd0d44f2841e12ec78cba
BLAKE2b-256 3b9209951ef03799ce90df45984535998e934aa9df0ae5e73e0bcddab0cef287

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Maceio-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 11e30f4b1e90fe0261ba95e88ed80158a1e486be3eea10b01a24c3eefa33c73c
MD5 6cad00bece085111fd1e300d6b2b5325
BLAKE2b-256 0e6d69994dfc9e7893a50e827f555ff21d638a787fbeeb2c43895eb6f5919f49

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