Timelink Python package

Contents:

  • The Timelink python package
  • Installation
  • Usage
  • Documentation
  • Timelink source documentation
    • timelink package
      • get_latest_version()
      • Subpackages
        • timelink.api package
        • timelink.app package
        • timelink.mhk package
        • timelink.migrations package
        • timelink.networks package
        • timelink.notebooks package
        • timelink.pandas package
      • Submodules
      • timelink.cli module
        • create_db_index()
        • db_autogenerate()
        • db_create_cmd()
        • db_current_cmd()
        • db_database_list_cmd()
        • db_heads()
        • db_history()
        • db_revision()
        • db_stamp()
        • db_upgrade_cmd()
        • main()
        • mhk_status()
        • mhk_version()
        • start()
      • timelink.timelink module
  • Contributing
  • Credits
  • History
Timelink Python package
  • Timelink source documentation
  • timelink package
  • View page source

timelink package

Timelink Python package.

Timelink, formerly known as MHK (Micro History with Kleio) is an information system designed for processing person related information collected from historical sources.

timelink.get_latest_version(package_name='timelink')[source]

Get the latest version of a package from PyPI.

Subpackages

  • timelink.api package
    • Subpackages
      • timelink.api.models package
        • Submodules
        • timelink.api.models.act module
        • timelink.api.models.aregister module
        • timelink.api.models.attribute module
        • timelink.api.models.base module
        • timelink.api.models.base_class module
        • timelink.api.models.base_mappings module
        • timelink.api.models.entity module
        • timelink.api.models.geoentity module
        • timelink.api.models.object module
        • timelink.api.models.person module
        • timelink.api.models.pom_som_mapper module
        • timelink.api.models.relation module
        • timelink.api.models.rentity module
        • timelink.api.models.source module
        • timelink.api.models.system module
    • Submodules
    • timelink.api.crud module
      • get()
      • get_syslog()
      • get_syslog_by_time()
      • get_syspar()
      • set_syslog()
      • set_syspar()
    • timelink.api.database module
      • KleioFile
        • KleioFile.path
        • KleioFile.name
        • KleioFile.size
        • KleioFile.directory
        • KleioFile.modified
        • KleioFile.modified_iso
        • KleioFile.modified_string
        • KleioFile.qtime
        • KleioFile.qtime_string
        • KleioFile.source_url
        • KleioFile.status
        • KleioFile.translated
        • KleioFile.translated_string
        • KleioFile.errors
        • KleioFile.warnings
        • KleioFile.version
        • KleioFile.rpt_url
        • KleioFile.xml_url
        • KleioFile.import_status
        • KleioFile.import_errors
        • KleioFile.import_warnings
        • KleioFile.import_error_rpt
        • KleioFile.import_warning_rpt
        • KleioFile.imported
        • KleioFile.imported_string
        • KleioFile.needs_translation()
        • KleioFile.needs_import()
        • KleioFile.model_config
        • KleioFile.needs_import()
        • KleioFile.needs_translation()
        • KleioFile.source_url
      • KleioServer
        • KleioServer.attach()
        • KleioServer.call()
        • KleioServer.container
        • KleioServer.extract_version_info()
        • KleioServer.find_local_kleio_home()
        • KleioServer.generate_token()
        • KleioServer.get_container()
        • KleioServer.get_home_page()
        • KleioServer.get_kleio_home()
        • KleioServer.get_logs()
        • KleioServer.get_report()
        • KleioServer.get_server()
        • KleioServer.get_source()
        • KleioServer.get_sources()
        • KleioServer.get_token()
        • KleioServer.get_translations()
        • KleioServer.get_url()
        • KleioServer.get_url_content()
        • KleioServer.get_version_info()
        • KleioServer.host
        • KleioServer.invalidate_user()
        • KleioServer.is_server_running()
        • KleioServer.kleio_admin_token
        • KleioServer.kleio_home
        • KleioServer.make_token()
        • KleioServer.start()
        • KleioServer.stop()
        • KleioServer.translate()
        • KleioServer.translation_clean()
        • KleioServer.url
      • TimelinkDatabase
        • TimelinkDatabase.db_url
        • TimelinkDatabase.db_name
        • TimelinkDatabase.db_user
        • TimelinkDatabase.db_pwd
        • TimelinkDatabase.engine
        • TimelinkDatabase.session
        • TimelinkDatabase.metadata
        • TimelinkDatabase.db_container
        • TimelinkDatabase.kserver
        • TimelinkDatabase.check_db()
        • TimelinkDatabase.create_db()
        • TimelinkDatabase.drop_db()
        • TimelinkDatabase.get_db()
        • TimelinkDatabase.get_engine()
        • TimelinkDatabase.get_metadata()
        • TimelinkDatabase.has_active_connections()
      • TimelinkDatabaseSchema
        • TimelinkDatabaseSchema.model_config
      • get_db_password()
      • get_import_status()
      • get_postgres_container()
      • get_postgres_container_pwd()
      • get_postgres_container_user()
      • get_postgres_dbnames()
      • get_postgres_url()
      • get_sqlite_databases()
      • get_sqlite_url()
      • import_from_xml()
      • import_status_enum
      • is_postgres_running()
      • is_valid_postgres_db_name()
      • random_password()
      • start_postgres_server()
    • timelink.api.database_postgres module
      • get_postgres_container()
      • get_postgres_container_pwd()
      • get_postgres_container_user()
      • get_postgres_dbnames()
      • get_postgres_url()
      • is_postgres_running()
      • is_valid_postgres_db_name()
      • start_postgres_server()
    • timelink.api.database_sqlite module
      • get_sqlite_databases()
      • get_sqlite_url()
    • timelink.api.database_utils module
      • get_db_password()
      • get_import_status()
      • random_password()
    • timelink.api.schemas module
      • AttributeSchema
        • AttributeSchema.model_config
      • EntityAttrRelSchema
        • EntityAttrRelSchema.model_config
      • EntityBriefSchema
        • EntityBriefSchema.model_config
      • EntitySchema
        • EntitySchema.id
        • EntitySchema.pom_class
        • EntitySchema.inside
        • EntitySchema.the_source
        • EntitySchema.the_order
        • EntitySchema.the_level
        • EntitySchema.the_line
        • EntitySchema.groupname
        • EntitySchema.updated
        • EntitySchema.indexed
        • EntitySchema.extra_info
        • EntitySchema.contains
        • EntitySchema.model_config
      • ImportStats
        • ImportStats.datetime
        • ImportStats.machine
        • ImportStats.database
        • ImportStats.file
        • ImportStats.import_time_seconds
        • ImportStats.entities_processed
        • ImportStats.entity_rate
        • ImportStats.person_rate
        • ImportStats.nerrors
        • ImportStats.errors
        • ImportStats.model_config
      • LinkSchema
        • LinkSchema.model_config
      • RealEntityAttrRelSchema
        • RealEntityAttrRelSchema.model_config
      • RealEntitySchema
        • RealEntitySchema.model_config
      • RelationInSchema
        • RelationInSchema.model_config
      • RelationOutSchema
        • RelationOutSchema.model_config
      • RelationSchema
        • RelationSchema.model_config
      • SearchRequest
        • SearchRequest.q
        • SearchRequest.after
        • SearchRequest.until
        • SearchRequest.skip
        • SearchRequest.limit
        • SearchRequest.model_config
      • SearchResults
        • SearchResults.model_config
    • timelink.api.views module
      • CreateView
      • DropView
      • view()
      • view_doesnt_exist()
      • view_exists()
  • timelink.app package
    • Subpackages
      • timelink.app.backend package
        • Submodules
        • timelink.app.backend.settings module
        • timelink.app.backend.timelink_webapp module
      • timelink.app.models package
        • Submodules
        • timelink.app.models.project module
        • timelink.app.models.user module
        • timelink.app.models.user_database module
      • timelink.app.schemas package
        • Submodules
        • timelink.app.schemas.project module
        • timelink.app.schemas.user module
      • timelink.app.services package
        • Submodules
        • timelink.app.services.auth module
        • timelink.app.services.syslog module
        • timelink.app.services.syspar module
    • Submodules
    • timelink.app.dependencies module
      • get_db()
      • get_github_auth()
      • get_kleio_server()
      • get_user_db()
  • timelink.mhk package
    • Subpackages
      • timelink.mhk.models package
        • Submodules
        • timelink.mhk.models.act module
        • timelink.mhk.models.attribute module
        • timelink.mhk.models.base module
        • timelink.mhk.models.base_class module
        • timelink.mhk.models.base_mappings module
        • timelink.mhk.models.db module
        • timelink.mhk.models.entity module
        • timelink.mhk.models.object module
        • timelink.mhk.models.person module
        • timelink.mhk.models.pom_som_mapper module
        • timelink.mhk.models.relation module
        • timelink.mhk.models.source module
        • timelink.mhk.models.system module
    • Submodules
    • timelink.mhk.utilities module
      • get_db_pwd()
      • get_dbnames()
      • get_env_as_dict()
      • get_mhk_app_env()
      • get_mhk_db_pwd()
      • get_mhk_env()
      • is_mhk_installed()
      • remove_quotes()
  • timelink.migrations package
    • autogenerate()
    • column_exists()
    • current()
    • downgrade()
    • get_versions()
    • heads()
    • history()
    • revision()
    • set_db_url()
    • stamp()
    • upgrade()
    • Submodules
    • timelink.migrations.alembic_extensions module
      • CreateViewOp
      • DropViewOp
      • ReplaceableObject
      • ReversibleOp
        • ReversibleOp.invoke_for_target()
        • ReversibleOp.replace()
  • timelink.networks package
    • Submodules
    • timelink.networks.network_draw module
    • timelink.networks.network_generation module
  • timelink.notebooks package
    • Submodules
    • timelink.notebooks.timelink_notebook module
      • TimelinkNotebook
        • TimelinkNotebook.get_file_paths()
        • TimelinkNotebook.get_import_rpt()
        • TimelinkNotebook.get_import_status()
        • TimelinkNotebook.get_imported_files()
        • TimelinkNotebook.get_kleio_files()
        • TimelinkNotebook.get_postgres_databases()
        • TimelinkNotebook.get_sqlite_databases()
        • TimelinkNotebook.get_translation_report()
        • TimelinkNotebook.print_info()
        • TimelinkNotebook.table_row_count_df()
        • TimelinkNotebook.update_from_sources()
  • timelink.pandas package
    • Submodules
    • timelink.pandas.attribute_values module
      • attribute_values()
    • timelink.pandas.entities_with_attribute module
      • entities_with_attribute()
    • timelink.pandas.group_attributes module
      • display_group_attributes()
      • group_attributes()
    • timelink.pandas.name_to_df module
      • pname_to_df()
    • timelink.pandas.styles module
      • category_palette()
      • style_color_row_by_category()
      • styler_row_colors()

Submodules

timelink.cli module

Console script for timelink.

Also provides basic mhk manager functionality.

Run with python -m timelink.cli

timelink.cli.create_db_index(avoid_patterns=None)[source]

Create a dictionary of databases

Parameters:

avoid_patterns (list) – list of patterns to avoid in the database name

Returns:

dictionary of databases, key is an integer,

value is a tuple of the form: (db_type, db_name, db_url)

Return type:

dict

timelink.cli.db_autogenerate(db_url: str, message: str)[source]

Create a new migration script using db_url as reference database

The current ORM models will be compared to the database schema and a migration script will be generated to bring the database to the current state of the ORM

A current database is kept at tests/db/reference_db/timelink_reference.sqlite

timelink.cli.db_create_cmd(db_url: str = <typer.models.ArgumentInfo object>)[source]

Create a new database

timelink.cli.db_current_cmd(db_url: str, verbose: str = '--verbose')[source]

Display current database revision

timelink.cli.db_database_list_cmd()[source]

List all available databases (sqlite, postgresql, etc)

timelink.cli.db_heads(db_url: str)[source]

Return the head(s) (current revision)

see: https://alembic.sqlalchemy.org/en/latest/api/runtime.html#alembic.runtime.migration.MigrationContext.get_current_heads

timelink.cli.db_history(verbose: bool = False)[source]

Show the migration history

timelink.cli.db_revision(db_url: str, message: str)[source]

Create a new migration script

timelink.cli.db_stamp(db_url: str, revision: str)[source]

Stamp the database to a given revision. Use ‘heads’ to mark the database as up-to-date

timelink.cli.db_upgrade_cmd(db_url: str, revision: str = 'heads')[source]

Update database to (most recent) revision

timelink.cli.main()[source]

This is the timelink/MHK manager on the command line

timelink.cli.mhk_status()[source]

shows docker status information

timelink.cli.mhk_version()[source]

shows MHK manager version

Demonstrates how to access MHK installation files and usage of Docker API

timelink.cli.start()[source]

Starts timelink with uvicorn

timelink.timelink module

Main module.

This is in timelink.py file

Previous Next

© Copyright 2024, Joaquim Ramos de Carvalho.

Built with Sphinx using a theme provided by Read the Docs.