Skip to main content

This project contains a loader of a special data set, as a connection to the database using pymssql

Project description

Project description:

This project contains a loader of a special data set, as well as a connection to the database using pymssql.

Prepare for project

First you need to create a settings.json in which the fields are specified:

"prefix_login" - If you need a prefix for login (if not required, add a field and pass an empty string),
"url" - Url for connection by token,
"cert_vault_tls" - The path to the security certificate,
"cert_vault_key" - The path to the security key,
"cert_vault_verify" - The path to the security verify

Get start:

First you need to import the package:

import pack_dataset

Now create an instance of the connection class:

datasets_loader = pack_dataset.create_connect()

And the data for connecting to the database is contained in the permanent environment, then they are automatically initialized. Connection to databases is carried out in 2 ways. The first is the connection via login and password:

datasets_loader.connect_to_db_with_login(login, password)

Or through a special token using the hvac library:

datasets_loader.connect_to_db_with_token(vault_token, vault_secret_engine, vault_path)

Now you just want to get a data set indicating how many rows you need to get (don’t specify lines if you want to unload everything):

dataset = datasets_loader.get_data_weather(row=15)

Manual connection to the database:

If, when creating a class, a message is displayed stating that it was not possible to get connection data to the database, you must specify them manually:

datasets_loader.connect_data['server'] = server:port
datasets_loader.connect_data['database'] = database_name
datasets_loader.connect_data['schema'] = schema_name
datasets_loader.connect_data['table'] = table_name

Next, you can connecting to the database (in any convenient way) and get a dataset:

datasets_loader.connect_to_db_with_login(login, password)
dataset = datasets_loader.get_data_weather(row=15)

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

pack_dataset-1.1.5.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file pack_dataset-1.1.5.tar.gz.

File metadata

  • Download URL: pack_dataset-1.1.5.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for pack_dataset-1.1.5.tar.gz
Algorithm Hash digest
SHA256 51929da4878678a5cfec0d50b03a74b7df0dd799037c992c257b58fabf8be8c1
MD5 f681aa75c2ac4a4f47dafd9ebe8893bb
BLAKE2b-256 dfd25108fc66ae62a77da4182df3209519d89659f7263d92d8734072fc729d45

See more details on using hashes here.

Supported by

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