module server.filestore_sqlite

Inheritance diagram of pyquickhelper.server.filestore_sqlite

Short summary

module pyquickhelper.server.filestore_sqlite

Simple class to store and retrieve files with a sqlite3 detabase.

source on GitHub

Classes

class

truncated documentation

SqlLite3FileStore

Simple file storage implemented with :epkg:`python:sqlite3`.

Static Methods

staticmethod

truncated documentation

v2s

Methods

method

truncated documentation

__init__

_check_same_column

_create

Creates the database if it does not exists.

_enumerate

_get_column_table

_get_connexion

enumerate

Queries the database, enumerates the results.

enumerate_content

Queries the database, enumerates the results, returns the content as well.

enumerate_data

Queries the database, enumerates the results.

submit

Submits a file to the database.

submit_data

Submits data to the database.

Documentation

Simple class to store and retrieve files with a sqlite3 detabase.

source on GitHub

class pyquickhelper.server.filestore_sqlite.SqlLite3FileStore(path='_file_store_.db3')[source]

Bases: object

Simple file storage implemented with :epkg:`python:sqlite3`.

Parameters:

path – location of the database.

source on GitHub

__init__(path='_file_store_.db3')[source]
_check_same_column(table, columns, con=None)[source]
_create()[source]

Creates the database if it does not exists.

source on GitHub

_enumerate(condition, fields)[source]
_get_column_table(table, con=None)[source]
_get_connexion()[source]
enumerate(name=None, format=None, date=None, metadata=None, team=None, project=None, version=None)[source]

Queries the database, enumerates the results.

Parameters:
  • name – filename

  • format – format

  • date – date, by default now

  • metadata – addition information

  • team – another name

  • project – another name

  • version – version

Returns:

results

source on GitHub

enumerate_content(name=None, format=None, date=None, metadata=None, team=None, project=None, version=None)[source]

Queries the database, enumerates the results, returns the content as well.

Parameters:
  • name – filename

  • format – format

  • date – date, by default now

  • metadata – addition information

  • team – another name

  • project – another name

  • version – version

Returns:

results

source on GitHub

enumerate_data(idfile=None, name=None, join=False, project=None)[source]

Queries the database, enumerates the results.

Parameters:
  • idfile – file identifier

  • name – value name, None if not specified

  • join – join with the table files

  • project – filter by project

Returns:

results

source on GitHub

submit(name, content, format=None, date=None, metadata=None, team=None, project=None, version=None)[source]

Submits a file to the database.

Parameters:
  • name – filename

  • content – file content (it can be a dataframe)

  • format – format

  • date – date, by default now

  • metadata – addition information

  • team – another name

  • project – another name

  • version – version

Returns:

added data as a dictionary (no content)

source on GitHub

submit_data(idfile, name, value, date=None, comment=None)[source]

Submits data to the database.

Parameters:
  • idfile – refers to database files

  • date – date, by default now

  • name – name

  • value – data value

  • comment – additional comment

Returns:

added data

source on GitHub