Compare commits

...

4 Commits

Author SHA1 Message Date
5cf265f09c Add CI
All checks were successful
continuous-integration/drone/tag Build is passing
2022-03-01 12:40:06 +01:00
91743d1c6d Add more topics, change version 2022-03-01 12:36:41 +01:00
516e08a707 Replace dashes with underscores, define entry point 2022-03-01 12:33:04 +01:00
ff645425f9 Add CSV files to gitignoree 2022-03-01 12:16:32 +01:00
5 changed files with 33 additions and 5 deletions

22
.drone.yml Normal file
View File

@ -0,0 +1,22 @@
---
kind: pipeline
type: docker
name: build and publish
steps:
- name: build
image: registry.kucharczyk.tech/python-pypi
commands:
- python -m build
- name: publish
image: registry.kucharczyk.tech/python-pypi
commands:
- python -m twine upload -u $USERNAME -p $PASSWORD dist/*
environment:
USERNAME:
from_secret: pypi_username
PASSWORD:
from_secret: pypi_password
trigger:
event:
- tag

1
.gitignore vendored
View File

@ -139,3 +139,4 @@ dmypy.json
cython_debug/ cython_debug/
testfiles testfiles
*.csv

View File

@ -25,7 +25,9 @@ fields = {
} }
def convert(directory="testfiles", outputfile="test.csv"): def convert(directory="f", outputfile="test.csv"):
if not os.path.isdir(directory):
exit(f"The directory {directory} does not exist!")
with open(outputfile, "w", newline="") as csvfile: with open(outputfile, "w", newline="") as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=fields.values()) writer = csv.DictWriter(csvfile, fieldnames=fields.values())
writer.writeheader() writer.writeheader()

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = frontmatter-to-csv name = frontmatter-to-csv
version = 0.0.1 version = 0.1.0
author = Lukáš Kucharczyk author = Lukáš Kucharczyk
author_email = lukas@kucharczyk.xyz author_email = lukas@kucharczyk.xyz
description = Convert YAML front matter to CSV description = Convert YAML front matter to CSV
@ -11,13 +11,16 @@ project_urls =
Bug Tracker = https://git.kucharczyk.xyz/lukas/frontmatter-to-csv/issues Bug Tracker = https://git.kucharczyk.xyz/lukas/frontmatter-to-csv/issues
classifiers = classifiers =
Programming Language :: Python :: 3 Programming Language :: Python :: 3
License :: OSI Approved :: MIT License Environment :: Console
Intended Audience :: End Users/Desktop
License :: OSI Approved :: GNU General Public License (GPL)
Operating System :: OS Independent Operating System :: OS Independent
Topic :: Utilities
[options] [options]
packages = frontmatter-to-csv packages = frontmatter_to_csv
python_requires = >=3.6 python_requires = >=3.6
[options.entry_points] [options.entry_points]
console_scripts = console_scripts =
frontmatter-to-csv = frontmatter-to-csv frontmatter-to-csv = frontmatter_to_csv.convert:convert