Search code examples
pythonfilemaker

Extract and manipulate data from FileMaker Pro 12 database with PyFileMaker2


I'm trying to connect to a FileMaker Pro 12.0v4 database for extracting and manipulating data. I have a Python 3.6.9 installed on a Windows10 64-bit PC. The file name of the FileMaker database I try to connect to is "C:/prova.fmp12"

Reading the different materials I was able to find on the subject (eg, https://code.google.com/archive/p/pyfilemaker/, https://pypi.org/project/pyfilemaker2/), I imported successfully the PyFileMaker2 module

import pyfilemaker2
from pyfilemaker2.server import FmServer
from pyfilemaker2.metadata import FmMeta
from pyfilemaker2.errors import FmError

The next step should be to pass the following command:

fm = FmServer('login:password@filemaker.domain.com')

However, I do not understand what actually the 'login:password@filemaker.domain.com' string stands for. I did multiple trials, but all the time when I then tried to get the name of the database:

fm.get_db_names()

I was given following messages:

InvalidSchema: No connection adapters were found for 'login://None:80password@filemaker.domain.com?-dbnames='

So, it is not clear to me how to make the actual connection to the file ('c:/prova.fmp12') and how to extract the data.


Solution

  • PyFileMaker connects to a FileMaker Server instance and your FileMaker File needs to be hosted on FileMaker Server with XML sharing enabled. Since you say that your FileMaker File is at C:/prova.fmp12 I imagine that you do not have prova.fmp12 hosted on a FileMaker Server.

    login:password@filemaker.domain.com

    This breaks down to

    • login = FileMaker File Username for an account with XML access priviliges
    • password = FileMaker File Password
    • filemaker.domain.com = The DNS that points to your FileMaker Server.

    From the documentation at https://pypi.org/project/pyfilemaker2/

    You will also need a FileMaker server with the XML enabled of course.