Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use stdin as input and stdout as output files #113

Merged
merged 4 commits into from
Dec 2, 2024

Conversation

haron
Copy link
Contributor

@haron haron commented Nov 23, 2024

This PR adds the ability to read from standard input and to write to standard output. Example:

> curl -L https://bicycledutch.wordpress.com/2018/02/20/a-common-urban-intersection-in-the-netherlands/ \
| python -m readabilipy -p \
| jq '.title'
"A common urban intersection in the Netherlands"

Copy link
Member

@jemrobinson jemrobinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes needed to avoid dangling file handles

readabilipy/__main__.py Show resolved Hide resolved
readabilipy/__main__.py Outdated Show resolved Hide resolved
@haron haron force-pushed the use-stdin-stdout branch 2 times, most recently from 03a3301 to 327056a Compare November 26, 2024 14:47
@haron
Copy link
Contributor Author

haron commented Dec 2, 2024

@jemrobinson please take a look at my fix.

@jemrobinson
Copy link
Member

@haron : Thanks for this - I've made a small refactor but I think these changes look good. Let me know if you're happy with this and I'll merge.

@haron
Copy link
Contributor Author

haron commented Dec 2, 2024

@jemrobinson I'm happy for sure, thank you!

@jemrobinson jemrobinson changed the base branch from master to update-tests December 2, 2024 21:56
@jemrobinson jemrobinson changed the base branch from update-tests to master December 2, 2024 21:57
@jemrobinson jemrobinson changed the base branch from master to update-tests December 2, 2024 21:58
@jemrobinson jemrobinson changed the base branch from update-tests to master December 2, 2024 21:59
readabilipy/__main__.py Outdated Show resolved Hide resolved
readabilipy/__main__.py Outdated Show resolved Hide resolved
@jemrobinson jemrobinson merged commit 9b9970e into alan-turing-institute:master Dec 2, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants