The somewhat superfluous Pinboard to Linkding migrator
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This is a script that takes a json export from pinboard then, using the Linkding REST API, insert them into Linkding
I didnt realize that Linkding supports importing of Netscape Bookmark File format. Exporting in that format in pinboard then is the prefered way of migrating from pinboard to Linkding.
By the time i realize this, I was already working on this project, so I decided to finish and publish this, despite the apparent uselessness.
This project is also a way for me to practice language that I don't use at work, so I thought might as well continue and finish this.
The REST API doesnt provide a way to insert multiple bookmarks in a batch, so each bookmark that needs to be inserted is a single REST API call.
My own json file with 2189 bookmarks took about 72 minutes. That is a rate of about 1.99 seconds per bookmarks insert. This is without any kind of parallelization on my side.
The REST API have no way to search for bookmarks based on URL. When inserting a URL that already exists, the behaviour of the REST API is to update the existing bookmarks with the info provided in the API call. This is a destructive process, potentially losing your existing notes and the tagging that you applied to the bookmark.
The create time of the inserted bookmarks will be the time of the import. Currently the workaround is: the actual create time of the bookmarks will be prepended to the description of the bookmarks.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
-
python
You need python to run python scripts. Find the appropriate installation instruction for your platform.
On debian based Linux systems: (or any that uses apt as the package manager)
apt install python3
-
python virtual environment (optional, but recommended)
python3 -m pip install --user virtualenv
-
git (optional) Easiest way to get these files is cloning this repo using git. Alternatively you can download the files as a zip and extract it somewhere.
On debian based Linux system:
apt install git
- Clone the repo, then go into the directory that we cloned
git clone https://github.com/ahmadfarhan1981/pinboard-linkding-migrator.git cd pinboard-linkding-migrator - Create a virtual environment for the script (optional, but recommended)
Then activate the virtual environment
python3 -m venv env
source env/bin/activate - Install the requirements
pip install -r requirements.txt
- Copy the example .env.example file as /env
cp .env.example .env
- Edit the .env file.
At least "PLM_LINKDING_API_KEY" & "PLM_LINKDING_URL" needs to be updated.
... PLM_LINKDING_API_KEY = [your linkding REST API token. Found in Settings->Intergration] PLM_LINKDING_URL = [Your linkding URL without the trailing slash] ...
- put the pinboard json export file into the same directory with the name "pinboard_export.json" (or update the "PLM_JSON_FILENAME" value in the .env file in step 5 to the name of your file)
- Run the script
python3 ./main.py
I do want to continue extending this. Some of the things I have in mind are listed here, in no particular order.
- Flask webapp
- Insert directly into linkding database, if have access
- More import/export targets other than just pinboard/Linkding
- Modularization. Supporting mods to add import/export targets
- docker image for easier install/use
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt for more information.
Ahmad Farhan - [email protected]
Project Link: https://github.com/ahmadfarhan1981/pinboard-linkding-migrator