Skip to main content

Easy image controller for obsidian. Change internal file links to externa

Project description

obs3dian

Easy image controller for obsidian. Change internal file links to external S3 links. Obs3dian converts local image file path to external url by uploading file in S3.

obs3dian converts image link text to external link.

![](./test.png)

will change to

![](https://YOUR_BUCKET.s3.YOUR_REGION.amazonaws.com/test.png)

obs3dian allows alt option or size options like

![[test.jpeg|500]]

![this is caption](test.gif)

and it also can converts image links used in obsidain

![[test.jpg|500]]

Installation

$ pip install obs3dian

Requirements

  • python > 3.10
  • AWS accounts with permissions to
    • create bucket
    • put image
    • set bucket public

Commands

$ obs3dian config

Config file is not founded... Input your configuration

AWS Profile Name [your aws profile]: 
S3 bucket Name [your bucket name]: 
Output Path [your ouput path]: 
Image Folder Path [your local image folder path]:
$ obs3dian apply

Connected to AWS S3
Bucket obs3dian is created
Create Output Folder in ./ouput
$ obs3dian run [your mark down path (file or directory)]

Processing  [############################--------]   78%
Finished    [README.md]

Processing  [#############################-------]   82%
Finished    [CONTRIBUTING.md]

Processing  [###############################-----]   86%
Finished    [LINKS.md] 

Processing  [################################----]   91%
Finished    [SUPPORTED_PLATFORMS.md]

Processing  [##################################--]   95%
Finished    [ISSUE_TEMPLATE.md]

Processing  [####################################]  100%

Total converts: 23 obs3dian is successfully finished

run command got options

  • --overwrite will overwrites all markdown files and not create output files under output folder.
  • --usekey forces obs3dian to use access key when connects to S3. In default obs3dian using CLI profile in connection.

You can get more info by --help option

$ obs3dian --help
$ obs3dian run --help
$ obs3dian apply --help

How it works

  • obs3dian reads config data to set enviroment
    • It creates S3 public read bucket by your aws account info
    • It creates output folder
  • obs3dian reads markdown files in given path
    • It also reads all .md files under subdir
  • obs3dian extracts all image names used in markdown and finds matching paths with names from given image folder
  • upload mathced images
  • Replace local image links to S3 external links

Info

  • obs3dian converts all *.md files under input path.
    • If given path is dir then dir/.md, dir/subdir/.md is all converted.
  • Created Bucket is public read.
  • run command automatically executes apply before run
  • obs3dian uses AWS CLI profile first. If you want to use access key pleas give --usekey when run.
  • obs3dian only supports .png, .jpg, .jpeg, .gif type images.

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

obs3dian-0.3.3.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

obs3dian-0.3.3-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file obs3dian-0.3.3.tar.gz.

File metadata

  • Download URL: obs3dian-0.3.3.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.5.0

File hashes

Hashes for obs3dian-0.3.3.tar.gz
Algorithm Hash digest
SHA256 e6b65522ca3ffc2b13ad94df7de5918aafd5d57baef984b06719308e566dffab
MD5 bbd56f0d82d44a935a426b3025447930
BLAKE2b-256 43e70b6ff6b9eb89fe7903a580bcd9e69efbcb83d31e1d4138aab7c59b82cb10

See more details on using hashes here.

File details

Details for the file obs3dian-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: obs3dian-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.5.0

File hashes

Hashes for obs3dian-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 12f14312127c7fdd0f3eeb32aca87f5fbff885baf3fb7533ea2e56c609fc99e8
MD5 6940f9cb7b71a9382f54b1f467daf1a7
BLAKE2b-256 cce690938934ff5daaccc63949d5200a4afdd540f5fc428510b225bfec3228b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page