A python module to interact with the data importing capabilities of the open-source FOLIO ILS
Project description
folio_data_import
Description
This project is designed to import data into the FOLIO LSP. It provides a simple and efficient way to import data from various sources using FOLIO's REST APIs.
Features
- Import MARC records using FOLIO's Data Import system
- Import User records using FOLIO's User APIs
Installation
Installation
To install the project using Poetry, follow these steps:
- Clone the repository.
- Navigate to the project directory:
$ cd /path/to/folio_data_import
. - Install Poetry if you haven't already:
$ pip install poetry
. - Install the project and its dependencies:
$ poetry install
. - Run the application using Poetry:
$ poetry run python -m folio_data_import --help
.
Make sure to activate the virtual environment created by Poetry before running the application.
Usage
- Prepare the data to be imported in the specified format.
- Run the application and follow the prompts to import the data.
- Monitor the import progress and handle any errors or conflicts that may arise.
folio-user-import
When this package is installed via PyPI or using poetry install
from this repository, it installs a convenience script in your $PATH
called folio-user-import
. To view all command line options for this script, run folio-user-import -h
. In addition to supporting mod-user-import
-style JSON objects, this script also allows you to manage service point assignments for users by specifying a servicePointsUser
object in the JSON object, using service point codes in place of UUIDs in the defaultServicePointId
and servicePointIds
fields:
{
"username": "checkin-all",
"barcode": "1728439497039848103",
"active": true,
"type": "patron",
"patronGroup": "staff",
"departments": [],
"personal": {
"lastName": "Admin",
"firstName": "checkin-all",
"addresses": [
{
"countryId": "HU",
"addressLine1": "Andrássy Street 1.",
"addressLine2": "",
"city": "Budapest",
"region": "Pest",
"postalCode": "1061",
"addressTypeId": "Home",
"primaryAddress": true
}
],
"preferredContactTypeId": "email"
},
"requestPreference": {
"holdShelf": true,
"delivery": false,
"fulfillment": "Hold Shelf"
}
"servicePointsUser": {
"defaultServicePointId": "cd1",
"servicePointsIds": [
"cd1",
"Online",
"000",
"cd2"
]
}
}
One thing to note here is that this importer does not require externalSystemId
as the match point for your objects. While it is the default, if the user objects have id
present, that will be used, falling back to externalSystemId
. However, you can also specify username
or barcode
as the match point if desired, using the --default_preferred_contact_type
argument.
Another point of departure from the behavior of mod-user-import
is the handling of preferredContactTypeId
. This importer will accept either the "001", "002", "003"...
values stored by the FOLIO, or the human-friendly strings used by mod-user-import
("mail", "email", "text", "phone", "mobile"
). It will also set a customizable default for all users that do not otherwise have a valid value specified, unless a value is already present in the user record being updated.
How to use:
- Generate a JSON lines (one JSON object per line) file of FOLIO user objects in the style of mod-user-import
- Run the script and specify the required arguments (and any desired optional arguments), including the path to your file of user objects
Contributing
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file folio_data_import-0.2.6.tar.gz
.
File metadata
- Download URL: folio_data_import-0.2.6.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | abf57892ce5bba597b80f8b17b7abc1e46c1cf988545e0ecc5bab6309068dcd8 |
|
MD5 | 3101c5399616ccd52b4fafa7347f0f42 |
|
BLAKE2b-256 | b72222258bf8d642d8d64c6a3b8b4285886015178141a81679ebff2c89b0d500 |
File details
Details for the file folio_data_import-0.2.6-py3-none-any.whl
.
File metadata
- Download URL: folio_data_import-0.2.6-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93632db45ce6a5fa39bd96ad4e4cdbb866cede6ce15d75fb74b10bb7f2f6217e |
|
MD5 | 09b142a1c87154080a0b6adccef54563 |
|
BLAKE2b-256 | 8ddf53e62e06d14b92abf11ae47a63e83a548476e29130ee78749ffd0e0a01d3 |