question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

⚡️ Generate Plaintext Ballots in CLI

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Suggestion

Generate plaintext ballots with a given manifest to CLI. PlaintextBallot should be generated with a random set of data from the Manifest according to valid ballot_styles from the Manifest.

Possible Implementation

The CLI should take a particular number of ballots to create and a dedicated ballot_style as a string to allow creating a specific style.

Marking a ballot is the term for creating a plaintext ballot so a command like so makes sense.

Example:

eg mark-ballots 100 "ballot-style-1"

Anything else?

This should take advantage of the already existing BallotFactory. It would be wise to boyscout this file where required. https://github.com/microsoft/electionguard-python/blob/main/src/electionguard_tools/factories/ballot_factory.py

As a heads up, information about @composite can be seen here: https://hypothesis.readthedocs.io/en/latest/data.html

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
phershbecommented, Jun 23, 2022

@lprichar Thank you for the answers. The things that you have helped me with are really good for my learning and you’re not getting anything back, so I really appreciate your time. I’ve made a lot of progress in my understanding but not much tangible progress. I’m trying to learn more about how to generate ballots in the CLI using poetry run. I have some free time today and I’m going to work on it quite a bit, but feel free to do what you need to do if it needs to get done.

0reactions
lpricharcommented, Jun 22, 2022

So sorry, I missed this @phershbe . That’s awesome that you’re learning so much. It is indeed a lot to learn, and it can’t be easy just looking through code. Let me start with your earlier questions.

Is the “eg” in eg = ‘electionguard_cli.start:cli’ in pyproject.toml the same “eg” used for poetry run eg e2e in Makefile?

Yes! The poetry run command executes the alias you mentioned that’s defined in the pyproject.toml file. That’s generally an implementation detail you don’t need to worry about though. If you’re planning on adding another command to the CLI you should start by creating a new command (like @click.command("mark-ballots") def mark_ballots()) and registering it into Click in src\electionguard_cli\start.py.

Will the eg mark-ballots 100 "ballot-style-1” suggested in the issue above go in the Makefile?

It probably should, but that’s really just an optional convenience. More important is adding a new command to the CLI so you can invoke it at the command line like poetry run eg mark-ballots.

However, all that said I wanted to give you a heads up that the team may need this task implemented soon. How much progress have you made? So far that’s just a possibility, but depending on your progress that might mean you and I work together, or I pick up where you left off.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cool copy and paste text
Symbol. It's very useful for generating Copy and paste After generating your fancy text symbols, you can copy and paste fonts for instagram,...
Read more >
Discord generator - Divadonna.it
Discord is one of the best social media platforms for the gaming community. redeem discoard unused code no survey no verification,free discord nitro...
Read more >
Symbol for fortnite
sweaty fortnite symbols, chinese symbol for fortnite copy and paste, chinese letters copy paste, special characters copy paste fortnite. 19. 2022. Command ......
Read more >
discord bot code
They have a "BOT" tag next to their username. Build Discord Bots Without Coding. ٢٥‏/٠٨‏/٢٠٢١ A complete code to download for a cool...
Read more >
Election Security Rumor vs. Reality - CISA
When a ballot cannot be read by a scanner at a voting site, election officials apply procedures to securely store the ballots until...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found