Skip to content

Commit

Permalink
Merge pull request #50 from bytewax/license-print
Browse files Browse the repository at this point in the history
Print out commercial software notification on import
  • Loading branch information
davidselassie authored Sep 13, 2024
2 parents 49d04c8 + 59703d9 commit 7f71e61
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ Values are always applied to the logic in timestamp (not arrival) order.

## License

bytewax-interval is commercially licensed with publicly available source code.
Please see the full details in [LICENSE](./LICENSE.md).
`bytewax-interval` is commercially licensed with publicly available
source code. You are welcome to prototype using this module for free,
but any use on business data requires a paid license. See
https://modules.bytewax.io/ for a license. Please see the full details
in [LICENSE](./LICENSE.md).
14 changes: 14 additions & 0 deletions src/bytewax/interval/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Time-based interval operators."""

import copy
import os
import sys
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from datetime import datetime, timedelta
Expand Down Expand Up @@ -43,6 +45,18 @@
)
from typing_extensions import TypeAlias, overload, override

if "BYTEWAX_LICENSE" not in os.environ:
msg = (
"`bytewax-interval` is commercially licensed "
"with publicly available source code.\n"
"You are welcome to prototype using this module for free, "
"but any use on business data requires a paid license.\n"
"See https://modules.bytewax.io/ for a license. "
"Set the env var `BYTEWAX_LICENSE=1` to suppress this message."
)
print(msg, file=sys.stderr)


LeftRight: TypeAlias = Literal["left", "right"]
"""Which side did a value come from."""

Expand Down

0 comments on commit 7f71e61

Please sign in to comment.