Skip to content

Commit 812e613

Browse files
committed
Added getpass
Instead of keyring or an environment variable, use getpass to set the SAM API_KEY.
1 parent 5fd586e commit 812e613

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "procurement-tools"
3-
version = "0.1.6_a"
3+
version = "0.1.6_b"
44
description = "Python tools for navigating federal contracting"
55
authors = ["V. David Zvenyach <dave@tandemgov.com>"]
66
readme = "README.md"

src/procurement_tools/sam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from .models.entity import Entity
22
from .uei import UEI
3+
from getpass import getpass
34
import keyring
45
import os
56
from pydantic import BaseModel, Field, field_validator, ValidationError
@@ -11,8 +12,7 @@
1112
try:
1213
API_KEY = keyring.get_password("system", "sam_api_key")
1314
except keyring.errors.NoKeyringError:
14-
print("No API KEY is set, please figure this out!")
15-
API_KEY = "NONE"
15+
API_KEY = getpass(prompt="Please enter your SAM API KEY")
1616
BASE_URL = f"https://api.sam.gov/entity-information/v3/entities?api_key={API_KEY}"
1717

1818

0 commit comments

Comments
 (0)