Coder Social home page Coder Social logo

fp5dump's Introduction

Fp5Dump

Fp5Dump allows you to parse, read and export FileMaker .fp5 and .fp3 files to postgres .psql files or insert/update them to a local postgres database.

The Filemaker types TEXT, NUMBER, DATE, TIME will be mapped the corresponding postgres types (numeric is used for NUMBER fields) unless the --assume-string option is specified.
FileMaker stores all values as strings and does not enforce a particular format for dates/numbers. The --locale option can be used if the values for numbers/dates are in a locale specific format, e.g.: --locale=de_DE will allow dates like 20.12.2014 and numbers like 123,456.
Repeated fields will be mapped to one dimentional arrays of a fixed size.

Supported field types are TEXT, NUMBER, DATE, TIME, CALC, SUMMARY. Fields of type CALC or SUMMARY can only be dumped if they are configured to be stored in the file. CONATINER fields are not (yet) supported.

Installation

  • download or clone this repositiory
  • open a terminal
  • change to the directory of the repository
  • python3 setup.py install

Basic usage

fp5dump [general-options] {action} <file> [action-options]

general-options

-v show info messages
-vv show debug messages

action is one of list-fields count-records dump-blocks dump-records insert-records update-records

file a readable fp5/fp3 file

list-fields

lists the fields in a filemaker file

fp5dump list-fields database.fp5 
        [--encoding <encoding>] [--show-unstored] [--include-fields-types <type>]

--include-fields-types <type>
type one or more of TEXT NUMBER DATE TIME CALC SUMMARY GLOBAL CONTAINER
by default all field types are included

--show-unstored
show fields (e.g. calculations, summaries and globals) who's values are not stored in the file

--encoding <encoding>
one of ascii cp1252 latin_1 macroman
the encoding to interpret strings values

count-records

shows the number of records in a fp5 file

fp5dump count-records database.fp5

dump-blocks

dumps the data or index blocks of a fp5 file in their logical order

fp5dump dump-blocks database.fp5 
        [--output <filename>] [--type <data|index>] [--with-path <path>]

-o <filename> --output <filename>
the name of the file the blocks are dumped to
by default a file with the suffix data, index or <path>.data will be written in the same directory

--type
one of index data, default is data dump either the index blocks of the fp5 file or the data blocks

--with-path <path>
only valid with --type data dumps only data block containing nodes of a certain path. paths are written as hex-bytes separated by /.
e.g. '03', '03/02', '05/7E46/42'

dump-records

dump the records of fp5 file to a psql file

fp5dump dump-records database.fp5 
        [--output <filename>] [--encoding <encoding>] [--progress]
        [--include-fields <name>] [--include-fields-like <regex>] 
        [--ignore-fields <name>] [--ignore-fields-like <regex>] 
        [--ignore-field-types <type>]

-o <filename> --output <filename>
the name of the file the blocks are dumped to by default a file with the suffix psql will be written in the same directory

--encoding <encoding>
encoding one of ascii cp1252 latin_1 macroman
the encoding to interpret strings values

-p --progress
shows the progress and estimated time to completion

--include-fields <name> and --include-fields-like <regex>
includes fields in the dump which are specified by name or which match one of the regex
if neither are specified all fields will be dumped

--ignore-fields <name> and --ignore-fields-like <regex>
excludes fields in the dump which are specified by name or which match one of the regex
exclusions overwrite inclusions

--ignore-field-types <type>
type one or more of TEXT NUMBER DATE TIME CALC SUMMARY GLOBAL CONTAINER
excludes fields of certain types
exclusions overwrite inclusions

insert-records

inserts the records of fp5 file unto a postgres database

fp5dump insert-records database.fp5 
        [--pg <postgres-connection-string>] [--encoding <encoding>] [--progress]
        [--include-fields <name>] [--include-fields-like <regex>] 
        [--ignore-fields <name>] [--ignore-fields-like <regex>] 
        [--ignore-field-types <type>]

**``--pg ** strings used to connect to postgres โ€“ should look like dbname='mydb' user='me' password='secret' host='localhost' port='5432'`

--encoding <encoding>
the encoding to interpret strings values
any valid python encoding can be chosen. defaults to "latin_1"

-p --progress
shows the progress and estimated time to completion

--include-fields <name> and --include-fields-like <regex>
includes fields in the dump which are specified by name or which match one of the regex
if neither are specified all fields will be dumped

--ignore-fields <name> and --ignore-fields-like <regex>
excludes fields in the dump which are specified by name or which match one of the regex
exclusions overwrite inclusions

--ignore-field-types <type>
type one or more of TEXT NUMBER DATE TIME CALC SUMMARY GLOBAL CONTAINER
excludes fields of certain types
exclusions overwrite inclusions

fp5dump's People

Contributors

qwesda avatar dlundgren avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.