Skip to main content

Module to parse dotclear backup files.

Project description

dotclear-backup-parser

dotclear-backup-parser is a Python module to parse Dotclear backup files (like 2024-01-07-11-22-dotclear-backup.txt).

Note

As there are no format specification for dotclear backup format, there is no way to "validate" parsed data are correct. Please always check your data.

Example

You load the backup content in a parser object:

import dotclear_backup_parser

# Load dotclear backup content.
with open("2024-01-07-11-22-dotclear-backup.txt") as fp:
    parser = dotclear_backup_parser.load(fp)

Then you can iterate over tables found in the backup file:

for table in parser:
    
    print(table.name, len(table.rows))
    
    for column_name in table.column_names:
        
        print(f"  {column_name}")

Tables are DcBackupTable object having three properties:

  • name (str): Table name.
  • column_names (list[str]): Name of the columns of the table.
  • rows (list[list[str]]): List of rows, each row is a list of value (same length as column_names).

Read the source for more information.

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

dotclear-backup-parser-0.0.1.tar.gz (38.7 kB view hashes)

Uploaded Source

Built Distribution

dotclear_backup_parser-0.0.1-py3-none-any.whl (27.2 kB view hashes)

Uploaded Python 3

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